package domain;
// Generated 26-jun-2009 19:31:47 by Hibernate Tools 3.2.1.GA


import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Income generated by hbm2java
 */
@Entity
@Table(name="income"
    ,catalog="domeco"
)
public class Income  implements java.io.Serializable {


     private Integer idIncome;
     private Bankaccount bankaccount;
     private String concept;
     private Date dateIncome;
     private double amount;

    public Income() {
    }

	
    public Income(Bankaccount bankaccount, Date dateIncome, double amount) {
        this.bankaccount = bankaccount;
        this.dateIncome = dateIncome;
        this.amount = amount;
    }
    public Income(Bankaccount bankaccount, String concept, Date dateIncome, double amount) {
       this.bankaccount = bankaccount;
       this.concept = concept;
       this.dateIncome = dateIncome;
       this.amount = amount;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idIncome", unique=true, nullable=false)
    public Integer getIdIncome() {
        return this.idIncome;
    }
    
    public void setIdIncome(Integer idIncome) {
        this.idIncome = idIncome;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="bankFK", nullable=false)
    public Bankaccount getBankaccount() {
        return this.bankaccount;
    }
    
    public void setBankaccount(Bankaccount bankaccount) {
        this.bankaccount = bankaccount;
    }
    
    @Column(name="concept", length=250)
    public String getConcept() {
        return this.concept;
    }
    
    public void setConcept(String concept) {
        this.concept = concept;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateIncome", nullable=false, length=10)
    public Date getDateIncome() {
        return this.dateIncome;
    }
    
    public void setDateIncome(Date dateIncome) {
        this.dateIncome = dateIncome;
    }
    
    @Column(name="amount", nullable=false, precision=22, scale=0)
    public double getAmount() {
        return this.amount;
    }
    
    public void setAmount(double amount) {
        this.amount = amount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idIncome != null ? idIncome.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Income)) {
            return false;
        }
        Income other = (Income) object;
        if ((this.idIncome == null && other.idIncome != null) || (this.idIncome != null && !this.idIncome.equals(other.idIncome))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.Income[idIncome=" + idIncome + "]";
    }





}


